﻿
@{
    ViewData["Title"] = "Index";
    Layout = "_OridinaryPage";
}

@section Header{
    <link rel="stylesheet" href="~/js/plugins/bootstrap-table/bootstrap-table.css" />
}

<section>
    <!--<h2>
        <small></small>
    </h2>-->
    <ol class="breadcrumb breadcrumb-pd clear-mgb bg-transparent">
        <li><a href="#"><i class="fa fa-dashboard"></i> 首页</a></li>
        <li class="active">Dashboard</li>
    </ol>
</section>
<!-- Main content -->
<section class="content-mini clear-pdt pd-rt-30 pd-lf-30 content-mini-index">
    <div class="row welcome">
        <div class="col-xs-12">
            <div class="nav-tabs-custom clear-mgb">
                <ul class="nav nav-tabs">
                    <li class="active"><a href="#underCheckingListTab" data-toggle="tab">需要我审批的记录</a></li>
                    <li><a href="#submitedListTab" data-toggle="tab">我提交的记录</a></li>
                    <li><a href="#onceListTab" data-toggle="tab">我曾处理的流程</a></li>
                    <li><a href="#userInfoTab" data-toggle="tab">个人信息查询</a></li>
                </ul>
                <div class="tab-content">
                    <!-- 需要我审批的记录 -->
                    <div class="tab-pane active" id="underCheckingListTab">
                        <table id="underCheckingList" class="table table-bordered clearBottomBorder person-table-index"></table>
                        <br />
                        <span class="labeltext"><b>审批意见：</b></span>
                        <input type="text" id="txtComment" name="txtComment" style="width: 500px" />
                        &nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;
                        <input type="button" id="btnSubmit" class="stbtm01" style="width: 60px;" value="确定"
                               onclick="javascript:Submit();" />
                    </div>
                    <!-- /#underCheckingList -->
                    <!-- 我提交的记录-->
                    <div class="tab-pane" id="submitedListTab">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="box box-shadow-none" style="border-top:none;margin-bottom:0;">
                                    <!--<div class="box-header">
                                        <h3 class="box-title"></h3>
                                    </div>-->
                                    <!-- /.box-header -->
                                    <div class="box-body" style="padding:0 !important;">
                                        <form class="form-horizontal" id="allSubmitListForm">
                                            <div class="form-group">
                                                <div class="container-fluid">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <div class="row">
                                                                <div class="col-xs-3">
                                                                    <label for="IsOpen" class="col-xs-3 control-label  text-left pd-lft pd-rt">申请类别</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        @Html.DDLApplyType("IsOpen", new { @id = "IsOpen", @class = "form-control" }, 1, true)
                                                                    </div>
                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="Type" class="col-xs-3 control-label  text-left pd-lft pd-rt">审批状态</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        @Html.DDLCheckStatus("Type", new { @id = "Type", @class = "form-control" }, 1, true)
                                                                    </div>
                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="ExpireDate" class="col-xs-3 control-label  text-left pd-lft pd-rt">申请时间</label>
                                                                    <div class="col-xs-9">
                                                                        <div class="row">
                                                                            <div class="col-xs-12  input-group">
                                                                                <input type="text" class="form-control Wdate Wdate-self col-xs-4 border-right-none" id="CreateDateStart" name="CreateDateStart" onFocus="WdatePicker({lang:'zh-cn',maxDate:'#F{\$dp.$D(\'CreateDateEnd\')}'})">
                                                                                <div class="input-group-addon border-left-none border-right-none">至</div>
                                                                                <input type="text" class="form-control Wdate Wdate-self col-xs-4 border-left-none" id="CreateDateEnd" name="CreateDateEnd" onFocus="WdatePicker({lang:'zh-cn',minDate:'#F{\$dp.$D(\'CreateDateStart\')}'})">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="CheckMan" class="col-xs-3 control-label  text-left pd-lft pd-rt">审批人</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        <input type="text" class="form-control" id="CheckMan" name="CheckMan">
                                                                    </div>

                                                                </div>

                                                            </div>
                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group" style="text-align:center;margin-top:10px;">
                                                <button type="button" class="btn btn-blue btnWidth120 boxShadowNone" id="btnSearshAllSubmitList">查询</button>
                                            </div>
                                        </form>
                                    </div>
                                    <!-- /.box-body -->
                                </div>
                                <!-- /.box -->
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                        <table id="allSubmitList" class="table table-bordered clearBottomBorder person-table-index"></table>
                    </div>
                    <!-- /#onceList -->
                    <!-- 我提交的记录-->
                    <div class="tab-pane" id="onceListTab">
                        <div class="row">
                            <div class="col-xs-12">
                                <div class="box box-shadow-none" style="border-top:none;margin-bottom:0;">
                                    <!--<div class="box-header">
                                        <h3 class="box-title"></h3>
                                    </div>-->
                                    <!-- /.box-header -->
                                    <div class="box-body" style="padding:0 !important;">
                                        <form class="form-horizontal" id="allOnceListForm">
                                            <div class="form-group">
                                                <div class="container-fluid">
                                                    <div class="row">
                                                        <div class="col-xs-12">
                                                            <div class="row">
                                                                <div class="col-xs-3">
                                                                    <label for="OnceIsOpen" class="col-xs-3 control-label  text-left pd-lft pd-rt">审批类别</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        @*用SearchCondition中的IsOpen来代表申请类别*@
                                                                        @Html.DDLApplyType("OnceIsOpen", new { @id = "OnceIsOpen", @class = "form-control" }, 1)
                                                                    </div>
                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="OnceType" class="col-xs-3 control-label  text-left pd-lft pd-rt">审批结果</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        @*用SearchCondition中的Type来代表审批状态*@
                                                                        @*@Html.DDLCheckStatus("OnceType", new { @id = "OnceType", @class = "form-control" }, true)*@
                                                                        <select class="form-control" id="OnceType" name="OnceType">
                                                                            <option value="-1">--请选择--</option>
                                                                            <option value="0">驳回</option>
                                                                            <option value="1">通过</option>

                                                                        </select>
                                                                    </div>
                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="OnceExpireDate" class="col-xs-3 control-label  text-left pd-lft pd-rt">审批时间</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        <div class="row">
                                                                            <div class="col-xs-12  input-group">
                                                                                <input type="text" class="form-control Wdate Wdate-self col-xs-4 border-right-none" id="OnceCreateDateStart" name="OnceCreateDateStart" onFocus="WdatePicker({lang:'zh-cn',maxDate:'#F{\$dp.$D(\'CreateDateEnd\')}'})">
                                                                                <div class="input-group-addon border-left-none border-right-none">至</div>
                                                                                <input type="text" class="form-control Wdate Wdate-self col-xs-4 border-left-none" id="OnceCreateDateEnd" name="OnceCreateDateEnd" onFocus="WdatePicker({lang:'zh-cn',minDate:'#F{\$dp.$D(\'CreateDateStart\')}'})">
                                                                            </div>
                                                                        </div>
                                                                    </div>

                                                                </div>
                                                                <div class="col-xs-3">
                                                                    <label for="OnceCheckMan" class="col-xs-3 control-label  text-left pd-lft pd-rt">提交人</label>
                                                                    <div class="col-xs-9 pd-lft">
                                                                        <input type="text" class="form-control" id="OnceCheckMan" name="OnceCheckMan">
                                                                    </div>

                                                                </div>

                                                            </div>

                                                        </div>
                                                    </div>
                                                </div>
                                            </div>

                                            <div class="form-group" style="text-align:center;margin-top:10px;">
                                                <button type="button" class="btn btn-blue btnWidth120 boxShadowNone" id="btnSearshAllOnceList">查询</button>
                                                <button type="button" class="btn btn-blue btnWidth120 boxShadowNone" id="btnSearshAllOnceListReset">重置</button>

                                            </div>
                                        </form>
                                    </div>
                                    <!-- /.box-body -->
                                </div>
                                <!-- /.box -->
                            </div>
                            <!-- /.col -->
                        </div>
                        <!-- /.row -->
                        <table id="allOnceList" class="table table-bordered clearBottomBorder person-table-index"></table>
                    </div>
                    <!-- /#submitedList -->
                </div>
                <!-- /.tab-content -->
            </div>
            <!-- /.nav-tabs-custom -->
        </div>
        <!-- /.col -->
    </div>
    <!-- /.row -->
</section>
<!-- /.content -->

@section Scripts{
    <script src="~/js/plugins/My97DatePicker/WdatePicker.js"></script>
    <!-- BootStrap-table -->
    <script src="~/js/plugins/bootstrap-table/bootstrap-table.min.js"></script>
    <script src="~/js/plugins/bootstrap-table/locale/bootstrap-table-zh-CN.js"></script>
    <script src="~/js/plugins/layer/layer/layer.js"></script>
    <script type="text/javascript">
        $(document).ready(function () {
            //1.初始化Table
            var oUnderCheckingListTable = new UnderCheckingListInit();
            oUnderCheckingListTable.Init();

            //var oAllSubmitListTable = new AllSubmitListInit();
            //oAllSubmitListTable.Init();
        });

        var targeturl = $("#targeturl").val();
        var typeId = $("#typeId").val();
        //var workflowId = $("#workflowId").val();
        //var workflowTempId = $("#workflowTempId").val();
        //var currentStep = $("#currentStep").val();
        var targeturl = $("#targeturl").val();

        //审批页面复制链接，销户Token登录需要直接打开审批框  && workflowTempId !== ""
        if (targeturl !== undefined && targeturl !== "" && typeId !== "") {
            showAuditDialog("/"+targeturl, typeId, '', '', 0)
        }
        $("a[href='#onceListTab']").click(function () {
            var oAllOnceListTable = new AllOnceListInit();
            oAllOnceListTable.Init();
        });


        $("a[href='#underCheckingListTab']").click(function () {
            refreshUnderCheckingList();
        });

        $("a[href='#submitedListTab']").click(function () {
            //refreshAllSubmitList();
            $("#allSubmitList").bootstrapTable('destroy');
            var oAllSubmitListTable = new AllSubmitListInit();
            oAllSubmitListTable.Init();
        });

        var UnderCheckingListInit = function () {
            var oTableInit = new Object();
            //初始化Table
            oTableInit.Init = function () {
                $('#underCheckingList').bootstrapTable({
                    url: '/Welcome/GetUnderCheckingList',   //请求后台的URL（*）
                    method: 'get',                      //请求方式（*）
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: true,                   //是否显示分页（*）
                    sortable: false,                    //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams,//传递参数（*）
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,                      //初始化加载第一页，默认第一页
                    pageSize: 15,                       //每页的记录行数（*）
                    pageList: [10, 15, 20, 30, 50],        //可供选择的每页的行数（*）
                    search: false,                      //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                    searchOnEnterKey: true,
                    strictSearch: true,
                    showColumns: false,                 //是否显示所有的列
                    showRefresh: false,                 //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    //height: 773,                      //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "TaskId",                 //每一行的唯一标识，一般为主键列
                    showToggle: false,                  //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                  //是否显示父子表
                    columns: [{
                        field: 'TaskId',
                        title: '操作',
                        halign: 'left',
                        width: '100px',
                        formatter: 'operateFormatter'
                    }, {
                        field: 'WorkflowName',
                        title: '申请类型',
                        halign: 'left'
                    },{
                          field: 'WorkflowId',
                          title: '批量审批',
                          halign: 'left',
                          formatter: function (val, rec, row) {
                              var chkOk = "chkOk" + row;
                              var chkReject = "chkReject" + row;
                              var html = '<span style="vertical-align:middle">同意</span><input type="checkbox" id=\'' + chkOk + '\' onclick="ChangeCheckStatus(this)" style="vertical-align:middle" /><span style="vertical-align:middle">驳回</span><input type="checkbox" id=\'' + chkReject + '\' onclick="ChangeCheckStatus(this)" style="vertical-align:middle" />';
                              if (rec.isbatch == '1') {
                                   return html;
                              }
                              else {
                                  return "";
                              }
                          }
                    }, {
                        field: 'Creator',
                        title: '申请人',
                        halign: 'left'
                    }, {
                        field: 'CreateDate',
                        title: '申请时间',
                            halign: 'left',
                            formatter: function (value, row, index) {
                                return getFormatDate(value)
                            }
                    }, {
                        field: 'CheckManTypeName',
                        title: '审批状态',
                        halign: 'left',
                        //formatter: 'statusNameFormatter'
                    }, {
                        field: 'CheckPinyinCode',
                        title: '审批人',
                        halign: 'left'
                    }, {
                        field: 'DeptName',
                        title: '部门名称',
                        halign: 'left'
                    }],
                    onLoadSuccess: function (res) {  //加载成功时执行
                        //console.info(res);
                    },
                    onLoadError: function () {  //加载失败时执行
                        //console.info("加载数据失败");
                    },
                    onPostHeader: function () {
                        //tab-content内的table去掉底边框（非表头底边框），高度自适应时底边框会叠加
                        $('.bootstrap-table .table').css('border-bottom-width', '0px');
                    }
                });
            };

            //得到查询的参数
            oTableInit.queryParams = function (params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    rowsPerPage: params.limit,  //每页数据行数
                    offsetRows: params.offset,  //已偏移行数
                    search: $("div.search input").val()
                    //search: params.search
                };
                return temp;
            };
            return oTableInit;
        };


        function ChangeCheckStatus(obj) {
            var id = obj.id.substring(0, obj.id.length - 1);
            var row = obj.id.substring(obj.id.length - 1);
            if (id == "chkOk") {
                $("#chkReject" + row).removeAttr("checked");
            }
            else {
                $("#chkOk" + row).removeAttr("checked");
            }
        }

        //格式化操作列的内容
        function operateFormatter(value, row, index) {
            var array = [];
            if (row.FlowStatus =='approving') {
                array.push('<a onclick="showAuditDialog(\'' + row.AuditUrl + '\',\'' + row.TaskId + '\')" class="operateLink"><i class="fa fa-pencil-square-o" ></i>&nbsp;审批</a>');
            }
            if (row.FlowStatus == 'resubmit') {
                array.push('<a onclick="showAuditDialog(\'' + row.SubmitUrl + '\',\'' + row.TaskId + '\')" class="operateLink"><i class="fa fa-pencil-square-o" ></i>&nbsp;重新提交</a>');
            }
            //array.push("<a onclick='showAuditDialog(" + row + ")' class='operateLink'><i class='fa fa-pencil-square-o' ></i>&nbsp;审批</a>");
            return array.join('');
        }

        //格式化审批状态
        function statusNameFormatter(value, row, index) {
            var postfix = "";
            if (row.status == '@(CheckStatus.Checking)') {
                postfix = "审批";
                return "待"+row.checkManTypeName + postfix;
            }else if (row.status == '@(CheckStatus.Refused)') {
                postfix = "处理";
                return "待"+row.checkManTypeName + postfix;
            }  else if (row.status == '@(CheckStatus.Passed)') {
                return "已结束";
            } else if (row.status == '@(CheckStatus.Canceled)') {
                return "已撤销";
            }

        }

        var AllSubmitListInit = function () {
            var oTableInit = new Object();
            //初始化Table
            oTableInit.Init = function () {
                $('#allSubmitList').bootstrapTable({
                    url: '/Welcome/GetAllSubmitList',   //请求后台的URL（*）
                    method: 'get',                      //请求方式（*）
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: true,                   //是否显示分页（*）
                    sortable: false,                    //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams,//传递参数（*）
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,                      //初始化加载第一页，默认第一页
                    pageSize: 15,                       //每页的记录行数（*）
                    pageList: [10, 15, 20, 30, 50],        //可供选择的每页的行数（*）
                    search: false,                      //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                    searchOnEnterKey: true,
                    strictSearch: true,
                    showColumns: false,                 //是否显示所有的列
                    showRefresh: false,                 //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    //height: 773,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "WorkflowTypeId",             //每一行的唯一标识，一般为主键列
                    showToggle: false,                  //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                  //是否显示父子表
                    columns: [{
                        field: 'TaskId',
                        title: '操作',
                        halign: 'left',
                        width: '100px',
                        formatter: function (value, row, index) {
                            var array = [];
                            if ('@SessionUtility.GetBasicUserInfo().PinyinCode' == row.Approver) {
                                if (row.WorkflowNodeCode.endsWith('Audit')) {
                                    array.push('<a onclick="showAuditDialog(\'' + row.AuditUrl + '\',\'' + row.TaskId + '\')" class="operateLink"><i class="fa fa-pencil-square-o" ></i>&nbsp;审批</a>');
                                }
                                if (row.WorkflowNodeCode.endsWith('_ReSubmitted')) {
                                    array.push('<a onclick="showAuditDialog(\'' + row.SubmitUrl + '\',\'' + row.TaskId + '\')" class="operateLink"><i class="fa fa-pencil-square-o" ></i>&nbsp;重新提交</a>');
                                }
                            } else {
                                array.push('<a onclick="showAuditDialog(\'' + row.AuditUrl + '\',\'' + row.TaskId + '\')" class="operateLink"><i class="fa fa-search" ></i>&nbsp;查看详情</a>');
                            }
                            return array.join('');
                        }
                    }, {
                        field: 'WorkflowName',
                        title: '申请类型',
                        halign: 'left'
                    }, {
                        field: 'ProxyMan',
                        title: '申请人',
                        halign: 'left'
                    }, {
                        field: 'CreateDate',
                        title: '申请时间',
                            halign: 'left',
                            formatter: function (value, row, index) {
                                return getFormatDate(value)
                            }
                    }, {
                            field: 'WorkflowNodeName',
                        title: '状态',
                        halign: 'left',
                        //formatter: 'statusNameFormatter'
                        }, {
                            field: 'Approver',
                            title: '审批人',
                            halign: 'left'
                        }, {
                        field: 'DeptName',
                        title: '部门名称',
                        halign: 'left'
                    }],
                    onLoadSuccess: function (res) {  //加载成功时执行
                        //console.info(res);
                    },
                    onLoadError: function () {  //加载失败时执行
                        //console.info("加载数据失败");
                    },
                    onPostHeader: function () {
                        //tab-content内的table去掉底边框（非表头底边框），高度自适应时底边框会叠加
                        $('.bootstrap-table .table').css('border-bottom-width', '0px');
                    }
                });
            };

            //得到查询的参数
            oTableInit.queryParams = function (params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    rowsPerPage: params.limit, //每页数据行数
                    offsetRows: params.offset, //已偏移行数
                    IsOpen: $("#IsOpen").val(),//申请类别
                    Type: $("#Type").val(),    //审批状态
                    CreateDateStart: $("#CreateDateStart").val(),//申请时间start
                    CreateDateEnd: $("#CreateDateEnd").val(),    //申请时间end
                    CheckMan: $("#CheckMan").val()               //当前审批人
                    //search: params.search
                };
                return temp;
            };
            return oTableInit;
        };

        //弹出审批对话框
        //function showAuditDialog(auditUrl, workflowTypeId, workflowId, workflowTempId, currentStep) {
        //    layer.open({
        //        type: 2,
        //        title: '审批页',
        //        offset: '40px', //设置弹出窗的top
        //        shadeClose: true,
        //        shade: 0.8,
        //        area: ['90%', '90%'],
        //        content: auditUrl + '?id=' + workflowTypeId + '&workflowId=' + workflowId + '&workflowTempId=' + workflowTempId + "&currentStep=" + currentStep
        //    });
        //}

        function showAuditDialog(auditUrl, taskId) {
            layer.open({
                type: 2,
                title: '审批页',
                offset: '40px', //设置弹出窗的top
                shadeClose: true,
                shade: 0.8,
                area: ['90%', '90%'],
                content: auditUrl + '?taskId=' + taskId
            });
        }

        function refreshUnderCheckingList() {
            //重新加载
            $("#underCheckingList").bootstrapTable('destroy');
            var oUnderCheckingListTable = new UnderCheckingListInit();
            oUnderCheckingListTable.Init();
        }

        $("#btnSearshAllSubmitList").click(function () {
            refreshAllSubmitList();
        });

        function refreshAllSubmitList() {
            //重新加载
            $("#allSubmitList").bootstrapTable('destroy');
            var oAllSubmitListTable = new AllSubmitListInit();
            oAllSubmitListTable.Init();
        }

        $("#btnSearshAllOnceList").click(function () {
            refreshSearchAllOnceList();
        });

        $("#btnSearshAllOnceListReset").click(function () {
            $("#OnceIsOpen").val("-1");
            $("#OnceType").val("-1");
            $("#OnceCreateDateStart").val("");
            $("#OnceCreateDateEnd").val("");
            $("#OnceCheckMan").val("");

            refreshSearchAllOnceList();
        });

        function refreshSearchAllOnceList() {
            //重新加载
            $("#allOnceList").bootstrapTable('destroy');
            var oAllOnceListTable = new AllOnceListInit();
            oAllOnceListTable.Init();
        }

        var AllOnceListInit = function () {
            var oTableInit = new Object();
            //初始化Table
            oTableInit.Init = function () {
                $('#allOnceList').bootstrapTable({
                    url: '/Welcome/GetAllOnceList',   //请求后台的URL（*）
                    method: 'get',                      //请求方式（*）
                    striped: true,                      //是否显示行间隔色
                    cache: false,                       //是否使用缓存，默认为true，所以一般情况下需要设置一下这个属性（*）
                    pagination: true,                   //是否显示分页（*）
                    sortable: false,                    //是否启用排序
                    sortOrder: "asc",                   //排序方式
                    queryParams: oTableInit.queryParams,//传递参数（*）
                    sidePagination: "server",           //分页方式：client客户端分页，server服务端分页（*）
                    pageNumber: 1,                      //初始化加载第一页，默认第一页
                    pageSize: 15,                       //每页的记录行数（*）
                    pageList: [10, 15, 20, 30, 50],        //可供选择的每页的行数（*）
                    search: false,                      //是否显示表格搜索，此搜索是客户端搜索，不会进服务端，所以，个人感觉意义不大
                    searchOnEnterKey: true,
                    strictSearch: true,
                    showColumns: false,                 //是否显示所有的列
                    showRefresh: false,                 //是否显示刷新按钮
                    minimumCountColumns: 2,             //最少允许的列数
                    clickToSelect: true,                //是否启用点击选中行
                    //height: 773,                        //行高，如果没有设置height属性，表格自动根据记录条数觉得表格高度
                    uniqueId: "workflowTypeId",             //每一行的唯一标识，一般为主键列
                    showToggle: false,                  //是否显示详细视图和列表视图的切换按钮
                    cardView: false,                    //是否显示详细视图
                    detailView: false,                  //是否显示父子表
                    columns: [{
                        field: 'workflowTypeId',
                        title: '操作',
                        halign: 'left',
                        width: '100px',
                        formatter: function (value, row, index) {
                            var array = [];
                            array.push('<a onclick="showAuditDialog(\'' + row.auditUrl + '\',\'' + row.workflowTypeId  + '\')" class="operateLink"><i class="fa fa-search" ></i>&nbsp;查看详情</a>');
                            return array.join('');
                        }
                    }, {
                        field: 'workflowName',
                        title: '申请类型',
                        halign: 'left'
                        }, {
                            field: 'workflowType',
                            title: '类型',
                            halign: 'left',
                            visible: false
                        },{
                            field: 'currentStep',
                            title: '步骤',
                            halign: 'left',
                            visible: false
                        }, {
                            field: 'workflowTypeId',
                            title: '实体id',
                            halign: 'left',
                            visible: false
                        }, {
                            field: 'workflowTempId',
                            title: '模板',
                            halign: 'left',
                            visible: false
                        },
                        {
                            field: 'proxyMan',
                        title: '申请人',
                        halign: 'left'
                    }, {
                        field: 'createDate',
                        title: '申请时间',
                        halign: 'left',
                        formatter: function (value, row, index) {
                            return changeDateFormat(value)
                        }
                    }, {
                            field: 'workflowNodeName',
                        title: '当前状态',
                        halign: 'left'
                        //formatter: 'statusNameFormatter'
                        }, {
                            field: 'checkPinyinCode',
                            title: '当前审批人',
                            halign: 'left'
                            @*formatter: function (val, rec, row) {
                                if (rec.status == '@((int)CheckStatus.审批中)' || rec.status == '@((int)CheckStatus.已驳回)') {
                                    return rec.checkPinyinCode
                                }
                                else {
                                    return "";
                                }
                            }*@
                        },
                        {
                        field: 'deptName',
                        title: '部门名称',
                        halign: 'left'
                    }],
                    onLoadSuccess: function (res) {  //加载成功时执行
                        //console.info(res);
                    },
                    onLoadError: function () {  //加载失败时执行
                        //console.info("加载数据失败");
                    },
                    onPostHeader: function () {
                        //tab-content内的table去掉底边框（非表头底边框），高度自适应时底边框会叠加
                        $('.bootstrap-table .table').css('border-bottom-width', '0px');
                    }
                });
            };
            //得到查询的参数
            oTableInit.queryParams = function (params) {
                var temp = {   //这里的键的名字和控制器的变量名必须一直，这边改动，控制器也需要改成一样的
                    limit: params.limit,       //页面大小
                    offset: params.offset,     //页码
                    IsOpen: $("#OnceIsOpen").val(),//申请类别
                    Type: $("#OnceType").val(),    //审批的状态
                    CreateDateStart: $("#OnceCreateDateStart").val(),//审批时间start
                    CreateDateEnd: $("#OnceCreateDateEnd").val(),    //审批时间end
                    ProxyMan: $("#OnceCheckMan").val()               //提交
                    //search: params.search
                };
                return temp;
            };
            return oTableInit;
        };
    </script>
}